import { request } from "@umijs/max";
import { stringify } from "qs";
//设施管理

//分页列表
export const getFacilityPage = (params: API.FacilityPage) =>
  request(`/facility/page?${stringify(params)}`, {
    method: "GET",
  });
//新增
export const addFacility = (params: API.FacilityInfo) =>
  request(`/facility/save`, {
    method: "POST",
    data: params,
  });
//修改
export const editFacility = (params: API.FacilityInfo) =>
  request(`/facility/edit`, {
    method: "POST",
    data: params,
  });
//查看详情
export const getFacilityDetail = (facilityId: number) =>
  request(`/facility/query?facilityId=${facilityId}`, {
    method: "GET",
  });
//删除
export const delFacility = (facilityIdArr: number[]) =>
  request(`/facility/del`, {
    method: "POST",
    data: { items: facilityIdArr },
  });

//查询设施列表
export const getFacilityList = () =>
  request("/facility/queryList", {
    method: "GET",
  });

